z += zspeed; 
zspeed -= zgrav; 
if(z < 0) 
{ 
    zspeed = 0; 
    z = 0; 
}